/*
	Author: mingxuan li
*/

var f3, f3Roads;
var f3pos, m4pos, m7pos;
var f3info, m4info, m7info;

function pickLastF3(arrayOfFiles){
	getF3(arrayOfFiles[arrayOfFiles.length-1]);
}

function getF3(f3File){
	f3 = parseJSON(f3_url+f3File);
}

function getF3Roads(){
	f3Roads = f3.features; // f3Roads are features
}

function get_Cat2_Roads(){
	getF3Roads();
	getM4Roads();
	getM7Roads();
}

function hashF3M4M7(){
	f3pos = [];
	m4pos = [];
	m7pos = [];
	f3info = [];
	m4info = [];
	m7info = [];
	for(var i = 0; i < f3Roads.length; i++){
		var latlng = getLatLng(f3Roads[i]);
		var info = getPropertyInfo_Cat2(f3Roads[i].properties);
		f3pos.push(latlng);
		f3info.push(info);
	}
	for(var i = 0; i < m4Roads.length; i++){
		var latlng = getLatLng(m4Roads[i]);
		var info = getPropertyInfo_Cat2(m4Roads[i].properties);
		m4pos.push(latlng);
		m4info.push(info);
	}
	for(var i = 0; i < m7Roads.length; i++){
		var latlng = getLatLng(m7Roads[i]);
		var info = getPropertyInfo_Cat2(m7Roads[i].properties);
		m7pos.push(latlng);
		m7info.push(info);
	}
}
